package com.lfc.observer;

public class ConcreteObserver implements Observer{
    private String observerState;
    @Override
    public void update(String state) {
         observerState=state;
        System.out.println("状态为："+observerState);
    }

    @Override
    public void update(Subject subject) {
        /**
         * 更新观察者的状态
         */
        observerState=((ConcreteSubject)subject).getState();
        System.out.println("观察者的状态为:"+observerState);
    }
}
